from app.crud import CRUDBase
from typing import Optional
from app.customer.models import Customer
from app.customer.schemas import CustomerCreate, CustomerUpdate


class CRUDCustomer(CRUDBase[Customer, CustomerCreate, CustomerUpdate]):
    async def get(self, id: int) -> Optional[Customer]:
        get_customer = await self.model.objects.select_related("expertises").get_or_none(pk=id)
        return get_customer


customer = CRUDCustomer(Customer)
